<template>
  <div class="conHead">
    <van-nav-bar
      :title="title"
      left-text="返回"
      right-text="首页"
      left-arrow
      @click-left="$router.go(-1)"
      @click-right="onClickRight"
    >
      <template #right>
        <van-icon name="home-o" size="18" />
      </template>
    </van-nav-bar>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      required: true
    }
  },
  methods: {
    onClickRight () {
      this.$router.push('/home')
    }
  }
}
</script>

<style lang="scss" scoped>
.conHead{
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  z-index: 10;
}
.van-nav-bar{
  background-color: #ea7293;
}
  /deep/.van-icon{
    font-size: 18px;
    color: #333;
  }
  /deep/.van-nav-bar__text{
    color: #333;
  }
</style>
